// msic function, not related to qq protocol

#ifndef _QQ_CHAR_CONV_H_
#define _QQ_CHAR_CONV_H_

#include <stdio.h> // printf, putchar
#include <string.h> // strlen
#include <arpa/inet.h>
#include "md5.h"
#include "common.h"
#include "glib.h"

void gen_ip_str(char ip_str[16], uint32 ip_addr);
gchar *utf8(const gchar* utf8_str);

gchar * locale_to_qq
(const gchar *str, gssize len, const gchar *to_charset);

gchar * qq_to_locale 
(const gchar *str, gssize len, const gchar *from_charset);

gchar * qq_encode_to_html
(uint8 *data, int len, const gchar *msg, const char *locale);

void hex_dump(unsigned char *buffer, int bytes);
void gen_pwkey(unsigned char *pwd, unsigned char *pwkey);

void gen_session_md5
(unsigned char *md5_str, int uid, unsigned char session_key[16]);

#endif
